﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using ESOL.Business.Mst;
using ESOL.Business.Hr;
using ESOL.Common;
using ESOL.Common.Entity;
using ESOL.WinUI.MasterData;

namespace ESOL.WinUI.Hr
{
    public partial class frmMaintainSalaryChangedHistory : BaseForm.frmBaseDialogyQueryForm
    {
        private MstPersonEntity mSelectedPerson;

        public frmMaintainSalaryChangedHistory(MstPersonEntity person)
        {
            InitializeComponent();
            mSelectedPerson = person;
        }

        private string GetCondition()
        {
            string condition = " AND SC.STATUS = 'STATUS03'";
            if (mSelectedPerson != null)
            {
                condition += " AND SC.PERSON_ID = '" + mSelectedPerson.PersonId + "'";
            }
            return condition;
        }

        private void BindDataGrid()
        {
            string condition = GetCondition();
            string orderBy = "CHANGE_DATE DESC";
            DataTable dt = HrSalaryChangeBs.GetByCondition(condition, orderBy, "");
            gvMain.DataSource = dt;
        }

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            BindDataGrid();
        }
    }
}
